package com.tansty.controller;

import com.tansty.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * description:  <br>
 * date: 2021/6/26 22:08 <br>
 * author: ztz <br>
 * version: 1.0 <br>
 */
@Controller
@RequestMapping("/books")
public class BookController {
    @Autowired
    private BookService bookService;

    @RequestMapping("/all")
    public String getall(Model model){
        model.addAttribute("list",bookService.getBooks());
        return "all";
    }
}
